<?php
/*
*Template Name: 所有公告
*/ 
get_header();
global $salong;
?>
<section class="container">
    <!-- 内容 -->
    <section class="bulletin_list">
        <ul class="ajaxposts">
            <?php $paged=( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;$args=array( 'post_type'=> 'bulletin','ignore_sticky_posts' => 1,'paged' => $paged ); $wp_query = new WP_Query( $args );if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post();
            $bulletin_url = get_post_meta( $post->ID, 'bulletin_url', true );
            if($bulletin_url){
                $url = $bulletin_url;
                if(!$link_go){
                    $target = 'target="_blank"';
                }
            }else{
                $url = get_permalink();
                $target = '';
            }
            ?>
            <li class="ajaxpost">
            <article class="box bulletin_amin">
                <a href="<?php echo $url; ?>" title="<?php the_title(); ?>" <?php echo $target.new_open_link(); ?>>
                <h3><?php the_title(); ?></h3>
                </a>
                <time>
                    <?php the_time( 'Y-m-d'); ?>
                </time>
                <!-- 摘要 -->
                <div class="excerpt">
                    <?php if (has_excerpt()) { ?>
                    <?php echo get_the_excerpt(); ?>
                    <?php } else{ echo wp_trim_words(get_the_content(),52); } ?>
                </div>
                <!-- 摘要end -->
            </article>
            </li>
            <?php endwhile;endif; ?>
            <!-- 分页 -->
            <?php posts_pagination(); ?>
    </section>
</section>
<?php get_footer(); ?>
